//+------------------------------------------------------------------+
//|                                    Weekly Plot_News reminder.mq4 |
//+------------------------------------------------------------------+

#property indicator_chart_window
//+------------------------------------------------------------------+
int init()  {
//+------------------------------------------------------------------+
  return(0);
}

//+------------------------------------------------------------------+
int deinit()  {
//+------------------------------------------------------------------+
  del_obj();
  return(0);
}

//+------------------------------------------------------------------+
int start()  {
//+------------------------------------------------------------------+
  display_reminder();
  return(0);
}

//+------------------------------------------------------------------+
void del_obj()  {
//+------------------------------------------------------------------+
  if (ObjectFind("Plot_News_FFcal_Reminder") >= 0)  ObjectDelete("Plot_News_FFcal_Reminder");
  return(0);
}

//+------------------------------------------------------------------+
void display_reminder()
//+------------------------------------------------------------------+
{
   if (ObjectFind("Plot_News_FFcal_Reminder") >= 0)     return(0);
   if (TimeDayOfWeek(TimeCurrent()) <= 4)
     {
      // If this is not Fri or Sat, then create a Text label reminder to run FFcal.exe
      // The assumption is there will always be at least 1 Friday FF event (usually true), 
      //   so that on Thursday or before, at least one future FF event will be found.
      //   But once Friday starts, you don't insist on finding future events.
      //   and don't issue any reminder until the start-of-the-week (Sunday) or later, up to Thur.
      double pr1 = Low[1] - 10*Point; // # pips below previous (not the current) bar Low
      ObjectCreate("Plot_News_FFcal_Reminder", OBJ_TEXT, 0, TimeCurrent(), pr1, 0,0,0,0);
      ObjectSetText("Plot_News_FFcal_Reminder", "REMINDER: Run FFcal.exe to get future events", 12, "Arial", Red);
     }
   return(0);
}

